package com.roubsite.cloud.security.service;

import com.roubsite.cloud.security.bean.RcUsers;
import com.roubsite.cloud.security.dao.RcUsersDao;
import com.roubsite.cloud.security.dao.RcUsersRoleDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lonesafe
 * @version 1.0.0
 * @description 用户登录处理
 */
@Service
public class UserDetailsServiceImpl {
	@Autowired
	RcUsersDao rcUsersDao;
	@Autowired
	RcUsersRoleDao rcUsersRoleDao;


	public RcUsers getUser(String username) {
		return rcUsersDao.loadByName(username);
	}

	public List<String> getUserAccessUrlsByUid(String uid){
		return rcUsersRoleDao.getRoleUrlByUserId(uid);
	}
}